<?
    if ( !$nZoom) $nZoom= 15;
    if ( !$nWidth ) $nWidth= 400;
    if ( !$nHeight )  $nHeight= 400;
    
if ( $_SERVER[SERVER_ADDR] == '10.10.1.83' ) {
   $api= 'ABQIAAAAmr4AwPjb-pLpzaqJgz1_WxRwj9yZgUYnzOSRiouDhHsGdC33SBRJnaE7ahLYN5E-OBKfFOGelqPHiQ';  $url = 'http://10.10.1.83/areas/turismo';
} else {
   $api= 'ABQIAAAAmr4AwPjb-pLpzaqJgz1_WxQvlppIxrFkW0_IgHk2Ir3D9P89XxSRn5BfWBPKyouGqMp_Eoa1EVq3pQ';  $url = 'http://www.bue.gov.ar.bue';
   //$api= 'ABQIAAAAmr4AwPjb-pLpzaqJgz1_WxRuJtq4zS4gJ_FCT7V6lUi7GMgC3RQQje7zJe7F04mqIOWJvRRQoh7sUA';  $url = 'http://www.bue.gov.ar';
}
   //$api= 'ABQIAAAAmr4AwPjb-pLpzaqJgz1_WxSDNxT5hfDFhHK-QY9PUUyN-Gd_rhS_KhczNTdtKoup8rWatFxZxyzGaQ'; $url = 'http://localhost/';
    //$url = 'http://www.hurrell.com.ar/'; $api= 'ABQIAAAAmr4AwPjb-pLpzaqJgz1_WxQbCtR2JKRMczOI0BgzY7-QkbB18BS5vV3URkPbhNzSyDtPlf_u3Ut1_Q';     
?><script src="http://maps.google.com/maps?file=api&v=2&key=<?=$api?>"  type="text/javascript"></script>
<script type="text/javascript">
var map;
var gmarkers = [];
function initialize() { 
if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas"));
<?
    if ( $nCenterLatitud && $nCenterLongitud ) echo  "map.setCenter(new GLatLng( $nCenterLatitud,  $nCenterLongitud), $nZoom);";
    if ( $bControles ) 
    {
        echo "map.addControl(new GLargeMapControl3D());";
        echo "map.addControl(new GMapTypeControl());";
        echo "map.addControl(new GScaleControl());";
        echo "map.addControl(new GOverviewMapControl());";
    }
?>
    <? foreach( $aDatos as $aDato) {     ?>
    map.addOverlay(createMarker(new GLatLng( <?=$aDato[2]?>, <?=$aDato[3]?>), "<?=strreplace($aDato[1])?>", "<?=strreplace($aDato[4])?>", "<?=strreplace($aDato[5])?>", "<?=strreplace($aDato[6])?>", "<?=strreplace($aDato[7])?>", "<?=strreplace($aDato[8])?>", "<?=$aDato[9]?>" ));
    <? } 
    if ( $bRecorrido ) {
    ?>    
    var polyline = new GPolyline([
    <? foreach( $aDatos as $aDato) {   ?>new GLatLng( <?=$aDato[2]?>, <?=$aDato[3]?>),<? } ?>  ], "#6666CC", 5); 
    map.addOverlay(polyline);
    <? } ?>

    } }
    window.onload=initialize;
    window.onunload=GUnload;
 <? if  ( getParam('rf')  )  echo 'initialize();';  ?>
    function createMarker(point, nombre, descripcion, direccion, web , telefono, email, icono ) {
        var iconito = new GIcon(G_DEFAULT_ICON);
        if ( icono )    iconito.image =   icono;
        markerOptions = { icon:iconito  };    
        var marker = new GMarker(point, markerOptions);
        gmarkers.push(marker);
        GEvent.addListener(marker, "click", function() {  marker.openInfoWindowHtml( '<h4>' + nombre + '</h4><p class=dato>' + direccion + '</p><p class=dato>' + telefono + '</p><p class=dato><a href=http://' + web + ' target=_blank>' + web + '</a></p><p class=dato><a href=mailto:' + email + '>' + email + '</a></p><p class=descripcion>' + descripcion + '</p>', {maxWidth:400} );  });
        return marker;
      }
     function clickRef(i) {   GEvent.trigger(gmarkers[i], "click");    }
     function changeMenu( idMenu)
     {
        oRef = document.getElementById('reference');
        oCanvas = document.getElementById('map_canvas');
        oRef.style.width ='25%';
        oCanvas .style.width ='75%';
        for( i = 1; i <= 5; i++ )
        {
            oMenu = document.getElementById('menuppal_' + i);
            if ( oMenu  )
            {
                oMenu.style.fontWeight= (i == idMenu) ? 'bold':'normal';
                oMenu.style.textDecoration= (i == idMenu) ? 'none':'underline';
            }
        }
     }
</script>
<div id="map_canvas" style='width: <?=$nWidth?>px;height: <?=$nHeight?>px;'></div>